/*
 Navicat Premium Data Transfer

 Source Server         : 10.18.104.33
 Source Server Type    : MySQL
 Source Server Version : 80020
 Source Host           : 10.18.104.33:3306
 Source Schema         : holiday_open_api

 Target Server Type    : MySQL
 Target Server Version : 80020
 File Encoding         : 65001

 Date: 16/07/2020 16:07:07
*/

-- ----------------------------
-- create database for holiday_open_api if not exists
-- ----------------------------
create database if not exists holiday_open_api;

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for holi_date
-- ----------------------------
DROP TABLE IF EXISTS `holi_date`;
CREATE TABLE `holi_date` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `date_time` date DEFAULT NULL COMMENT '日期',
  `weekday` int DEFAULT NULL COMMENT '星期的天数，从1开始',
  `year` int DEFAULT NULL COMMENT '年份',
  `month` int DEFAULT NULL COMMENT '月份',
  `day` int DEFAULT NULL COMMENT '日',
  `holiday` tinyint DEFAULT NULL COMMENT '是否应该放假',
  `holiday_name` varchar(64) DEFAULT NULL COMMENT '节假日名字',
  `holiday_type` int DEFAULT '0' COMMENT '当日类型；0:正常上班，1:周末，2:节假日，3:调休上班',
  `created_at` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '创建日期',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  `deleted_at` datetime DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of holi_date
-- ----------------------------
BEGIN;
INSERT INTO `holi_date` VALUES (1, '2020-10-02', 5, 2020, 10, 2, 1, '国庆节,中秋节', 3, '2020-07-16 11:26:52', '2020-07-16 10:50:00', '2020-07-16 11:26:53');
INSERT INTO `holi_date` VALUES (2, '2020-08-08', 6, 2020, 8, 8, 1, '中秋节', 2, '2020-07-16 11:38:22', '2020-07-16 10:46:24', '2020-07-16 11:38:22');
INSERT INTO `holi_date` VALUES (3, '2020-08-09', 0, 2020, 8, 9, 1, '2020-08-09-new', 2, '2020-07-16 11:26:24', '2020-07-16 11:15:59', '2020-07-16 11:26:25');
INSERT INTO `holi_date` VALUES (4, '2020-07-25', 6, 2020, 7, 25, 1, '随便什么名字', 2, '2020-07-16 14:22:37', '2020-07-15 14:11:47', '2020-07-16 14:22:38');
INSERT INTO `holi_date` VALUES (5, '2020-07-31', 5, 2020, 7, 31, 1, '随便什么名字2', 2, '2020-07-16 11:39:10', '2020-07-15 14:14:09', '2020-07-16 11:39:10');
INSERT INTO `holi_date` VALUES (6, '2020-07-28', 2, 2020, 7, 28, 1, '节假日随便名字112', 2, '2020-07-16 14:22:32', '2020-07-15 14:34:18', '2020-07-16 14:22:33');
INSERT INTO `holi_date` VALUES (7, '2020-01-01', 3, 2020, 1, 1, 1, '元旦节', 2, '2020-07-16 14:28:30', '2020-07-16 14:28:30', NULL);
INSERT INTO `holi_date` VALUES (8, '2020-07-30', 4, 2020, 7, 30, 1, '14:43', 2, '2020-07-16 11:39:17', '2020-07-15 14:43:36', '2020-07-16 11:39:17');
INSERT INTO `holi_date` VALUES (9, '2020-07-20', 1, 2020, 7, 20, 1, '7月20日', 2, '2020-07-16 14:23:11', '2020-07-15 15:13:25', '2020-07-16 14:23:12');
INSERT INTO `holi_date` VALUES (10, '2020-07-21', 2, 2020, 7, 21, 1, '07-21', 2, '2020-07-16 14:23:09', '2020-07-15 15:15:36', '2020-07-16 14:23:09');
INSERT INTO `holi_date` VALUES (11, '2020-07-09', 4, 2020, 7, 9, 1, '07-09', 2, '2020-07-16 14:23:21', '2020-07-15 15:17:14', '2020-07-16 14:23:21');
INSERT INTO `holi_date` VALUES (12, '2020-07-13', 1, 2020, 7, 13, 1, '7-13', 2, '2020-07-16 14:23:17', '2020-07-15 15:21:11', '2020-07-16 14:23:18');
INSERT INTO `holi_date` VALUES (13, '2020-07-22', 3, 2020, 7, 22, 1, '7-23', 2, '2020-07-16 14:23:05', '2020-07-15 15:23:17', '2020-07-16 14:23:05');
INSERT INTO `holi_date` VALUES (14, '2020-07-17', 5, 2020, 7, 17, 1, '7-17', 2, '2020-07-16 14:23:14', '2020-07-15 15:24:52', '2020-07-16 14:23:14');
INSERT INTO `holi_date` VALUES (15, '2020-08-02', 0, 2020, 8, 2, 0, '8-2调休上班', 3, '2020-07-16 11:39:00', '2020-07-16 09:57:56', '2020-07-16 11:39:00');
INSERT INTO `holi_date` VALUES (16, '2020-01-19', 0, 2020, 1, 19, 0, '除夕调休上班', 3, '2020-07-16 14:29:26', '2020-07-16 14:29:26', NULL);
INSERT INTO `holi_date` VALUES (17, '2020-01-24', 5, 2020, 1, 24, 1, '除夕', 2, '2020-07-16 14:31:30', '2020-07-16 14:31:30', NULL);
INSERT INTO `holi_date` VALUES (18, '2020-01-25', 6, 2020, 1, 25, 1, '春节', 2, '2020-07-16 14:32:15', '2020-07-16 14:32:15', NULL);
INSERT INTO `holi_date` VALUES (19, '2020-01-26', 0, 2020, 1, 26, 1, '春节第二天', 2, '2020-07-16 14:34:59', '2020-07-16 14:34:59', NULL);
INSERT INTO `holi_date` VALUES (20, '2020-01-27', 1, 2020, 1, 27, 1, '春节第三天', 2, '2020-07-16 14:35:18', '2020-07-16 14:35:18', NULL);
INSERT INTO `holi_date` VALUES (21, '2020-01-28', 2, 2020, 1, 28, 1, '春节第四天', 2, '2020-07-16 14:37:06', '2020-07-16 14:37:06', NULL);
INSERT INTO `holi_date` VALUES (22, '2020-01-29', 3, 2020, 1, 29, 1, '春节第五天', 2, '2020-07-16 14:37:26', '2020-07-16 14:37:26', NULL);
INSERT INTO `holi_date` VALUES (23, '2020-01-30', 4, 2020, 1, 30, 1, '春节第六天', 2, '2020-07-16 14:37:51', '2020-07-16 14:37:51', NULL);
INSERT INTO `holi_date` VALUES (24, '2020-01-31', 5, 2020, 1, 31, 1, '春节第七天', 2, '2020-07-16 14:38:15', '2020-07-16 14:38:15', NULL);
INSERT INTO `holi_date` VALUES (25, '2020-02-01', 6, 2020, 2, 1, 1, '春节第八天', 2, '2020-07-16 14:39:07', '2020-07-16 14:39:07', NULL);
INSERT INTO `holi_date` VALUES (26, '2020-02-02', 0, 2020, 2, 2, 1, '春节第九天', 2, '2020-07-16 14:39:18', '2020-07-16 14:39:18', NULL);
INSERT INTO `holi_date` VALUES (27, '2020-04-04', 6, 2020, 4, 4, 1, '清明节第一天', 2, '2020-07-16 14:39:59', '2020-07-16 14:39:59', NULL);
INSERT INTO `holi_date` VALUES (28, '2020-04-05', 0, 2020, 4, 5, 1, '清明节第二天', 2, '2020-07-16 14:40:18', '2020-07-16 14:40:18', NULL);
INSERT INTO `holi_date` VALUES (29, '2020-04-06', 1, 2020, 4, 6, 1, '清明节第三天', 2, '2020-07-16 14:40:34', '2020-07-16 14:40:34', NULL);
INSERT INTO `holi_date` VALUES (30, '2020-04-26', 0, 2020, 4, 26, 0, '劳动节换班', 0, '2020-07-16 14:41:23', '2020-07-16 14:41:23', NULL);
INSERT INTO `holi_date` VALUES (31, '2020-05-01', 5, 2020, 5, 1, 1, '劳动节第一天', 2, '2020-07-16 14:42:36', '2020-07-16 14:42:36', NULL);
INSERT INTO `holi_date` VALUES (32, '2020-05-02', 6, 2020, 5, 2, 1, '劳动节第二天', 2, '2020-07-16 14:42:50', '2020-07-16 14:42:50', NULL);
INSERT INTO `holi_date` VALUES (33, '2020-05-03', 0, 2020, 5, 3, 1, '劳动节第三天', 2, '2020-07-16 14:42:59', '2020-07-16 14:42:59', NULL);
INSERT INTO `holi_date` VALUES (34, '2020-05-04', 1, 2020, 5, 4, 1, '劳动节第四天', 2, '2020-07-16 14:43:10', '2020-07-16 14:43:10', NULL);
INSERT INTO `holi_date` VALUES (35, '2020-05-05', 2, 2020, 5, 5, 1, '劳动节第五天', 2, '2020-07-16 14:43:23', '2020-07-16 14:43:23', NULL);
INSERT INTO `holi_date` VALUES (36, '2020-05-09', 6, 2020, 5, 9, 0, '劳动节换班', 3, '2020-07-16 14:43:49', '2020-07-16 14:43:49', NULL);
INSERT INTO `holi_date` VALUES (37, '2020-06-25', 4, 2020, 6, 25, 1, '端午节第一天', 2, '2020-07-16 14:44:37', '2020-07-16 14:44:37', NULL);
INSERT INTO `holi_date` VALUES (38, '2020-06-26', 5, 2020, 6, 26, 1, '端午节第二天', 2, '2020-07-16 14:44:46', '2020-07-16 14:44:46', NULL);
INSERT INTO `holi_date` VALUES (39, '2020-06-27', 6, 2020, 6, 27, 1, '端午节第三天', 2, '2020-07-16 14:45:04', '2020-07-16 14:45:04', NULL);
INSERT INTO `holi_date` VALUES (40, '2020-06-28', 0, 2020, 6, 28, 0, '端午节换班', 3, '2020-07-16 14:45:21', '2020-07-16 14:45:21', NULL);
INSERT INTO `holi_date` VALUES (41, '2020-09-27', 0, 2020, 9, 27, 0, '国庆节换班', 3, '2020-07-16 14:46:26', '2020-07-16 14:46:26', NULL);
INSERT INTO `holi_date` VALUES (42, '2020-10-01', 4, 2020, 10, 1, 1, '国庆节、中秋节', 2, '2020-07-16 14:47:47', '2020-07-16 14:47:48', NULL);
INSERT INTO `holi_date` VALUES (43, '2020-10-02', 5, 2020, 10, 2, 1, '国庆节第二天', 2, '2020-07-16 14:48:10', '2020-07-16 14:48:10', NULL);
INSERT INTO `holi_date` VALUES (44, '2020-10-03', 6, 2020, 10, 3, 1, '国庆节第三天', 2, '2020-07-16 14:48:22', '2020-07-16 14:48:22', NULL);
INSERT INTO `holi_date` VALUES (45, '2020-10-04', 0, 2020, 10, 4, 1, '国庆节第四天', 2, '2020-07-16 14:48:47', '2020-07-16 14:48:47', NULL);
INSERT INTO `holi_date` VALUES (46, '2020-10-05', 1, 2020, 10, 5, 1, '国庆节第五天', 2, '2020-07-16 14:48:56', '2020-07-16 14:48:56', NULL);
INSERT INTO `holi_date` VALUES (47, '2020-10-06', 2, 2020, 10, 6, 1, '国庆节第六天', 2, '2020-07-16 14:49:05', '2020-07-16 14:49:05', NULL);
INSERT INTO `holi_date` VALUES (48, '2020-10-07', 3, 2020, 10, 7, 1, '国庆节第七天', 2, '2020-07-16 14:49:15', '2020-07-16 14:49:15', NULL);
INSERT INTO `holi_date` VALUES (49, '2020-10-08', 4, 2020, 10, 8, 1, '国庆节第八天', 2, '2020-07-16 14:49:25', '2020-07-16 14:49:25', NULL);
INSERT INTO `holi_date` VALUES (50, '2020-10-10', 6, 2020, 10, 10, 0, '国庆节换班', 3, '2020-07-16 14:49:43', '2020-07-16 14:49:43', NULL);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;

ALTER TABLE `holi_date`
    MODIFY COLUMN `created_at` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建日期' AFTER `holiday_type`,
    MODIFY COLUMN `updated_at` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间' AFTER `created_at`;


